import { lazy } from 'react'
import { RouterItem, RouterType } from '../e'
export const postersChild: RouterItem[] = [
    {
        key: "5",
        path: "/materials",
        element: lazy(() => import('../page/posters/materials/Index')),
        title: "印刷物料",
    },
    {
        key: "19",
        pid: "9",
        path: "/longposters",
        element: lazy(() => import('../page/posters/longPosters/Index')),
        title: "长图海报",
    },
]
// export const drawTools:RouterItem[]=[
//     {
        
//     }
// ]
export const routerChildren: RouterType[] = [
    {
        // type: ,
        children: [
            {
                key: "1",
                path: "/index/recomment",
                element: lazy(() => import('../page/content/Recomment')),
                title: "精选推荐",
                icon: "shouye",
            },
            {
                key: "2",
                path: "/index/template",
                element: lazy(() => import('../page/template/Index')),
                title: "模版中心",
                icon: "mobanzhongxin-xuanzhong"
            },
            {
                key: "3",
                path: "/index/people",
                element: lazy(() => import('../page/numPeopleVideo/Index')),
                title: "数字人视频",
                icon: "shuzihua",
                span: "新品",
            },
            {
                key: "4",
                path: "/index/ai",
                element: lazy(() => import('../page/ai/Index')),
                title: "AI创作",
                icon: "caidan-AIchuangzuo",
            },

        ]
    },
    {
        type: "创意设计",
        children: [
            {
                key: "8",
                path: "/index/h5",
                element: lazy(() => import('../page/H5/Index')),
                title: "H5",
                icon: "caidan-AIchuangzuo",
            },
            {
                key: "9",
                path: "/index/posters",
                element: lazy(() => import('../page/posters/Index')),
                title: "海报",
                icon: "caidan-AIchuangzuo",
                cid: postersChild

            }
        ]
    }
]
var aa: RouterItem[] = []
routerChildren.forEach((i: RouterType, j: number) => {
    i.children.forEach(element => {
        aa.push(element)
    });
})
const routerList: RouterItem[] = [
    ...postersChild,
    {
        path: "/",
        to: "/index/recomment",
        icon: "",
        key: "0",
    },
    {
        key: "11",
        path: "/index",
        element: lazy(() => { return import('../page/content/Firstpage') }),
        title: '首页',
        icon: "",
        children: aa
    },
    {
        key: "4",
        path: "/tools",
        element: lazy(() => import('../page/picture/Index')),
        title: "作图工具",
        icon: "xiugai",
        span: "新品",

    },



]

export default routerList